1. Field of the Invention
The present invention relates to a protocol processing apparatus that receives and reassembles a fragmented IP datagram, and a processing method thereof.
2. Description of the Related Art
Conventionally, reassembly of a fragmented IP datagram is performed as a part of network protocol processing. Methods of fragmentation and reassembly of IP datagrams are described in RFC 791 Internet Protocol. RFC 791 introduces a reassembly method using a fragment block bit table (hereinafter referred to as a bit table) as a reassembly example. Reassembly using a bit table requires a bit table of 8192 bits.
This is due to the fact that the maximum payload size of an IP datagram prior to fragmentation is 64 Kbytes and that an IP datagram can be fragmented in 8 byte units. That is, when transmitting an IP datagram with a payload of 64 Kbytes split into IP datagrams with a payload of 8 bytes that is the minimum payload size, the original IP datagram is split into 8192 (=64 Kbytes÷8 bytes) IP datagrams.
Therefore, a bit table of 8192 bits is required to manage the reception status of the fragmented IP datagram.
Consequently, it is conceivable that a bit table of 64 Kbytes that is the maximum payload size of an IP datagram need not be prepared if the payload size of the IP datagram prior to fragmentation is known in advance. However, only the following two fields are attached as fragment-related information to the header of IP datagrams as defined by RFC 791.
(1) FO (Fragment Offset): offset of the payload of an IP datagram prior to fragmentation.
(2) MF (More Fragments flag): flag indicating whether subsequent fragmented packets exist or not.
Therefore, while the MF of an IP header of a fragmented end IP datagram has not been set, the MFs of IP headers of all other fragmented IP datagrams have been set. In other words, unless the fragmented end IP datagram is received, the payload size of the IP datagram prior to fragmentation cannot be determined. Therefore, a bit table of 64 Kbytes that is the maximum payload for an IP datagram must be prepared.
On the other hand, it is conceivable that a bit table of 8 byte-units need not be prepared if the split payload size during fragmentation is known in advance. However, a communication network interconnecting various routers exists between a transmitting device and a receiving device of an IP datagram, and it is impossible to confirm or control which of the routes in the communication network is to be used to transmit the IP datagram. That is, there is no way to know at what size an IP datagram to possibly be fragmented by any of the routers will be fragmented upon arrival at the receiving device. Therefore, the bit table must be prepared in 8 byte-units that is the minimum payload size to be split by fragmentation.
Moreover, Japanese Patent Laid-Open No. 2007-274056 describes numbering in an order of fragmented packets and managing a reassembly state using a bitmap that associates the numbers with bit positions.
A size of 8192 bits must be secured for the conventional bit table described above even when receiving IP datagrams whose payload size is less than 64 Kbytes. In addition, a bit table in 8 byte-units must be secured even when the payload sizes of fragmented IP datagrams are standardized to, for example, 1 Kbyte.
This restriction means that when receiving an IP datagram whose payload size is smaller than 64 Kbytes or an IP datagram whose payload size during fragmentation is fixed, an area of the bit table is to be needlessly secured. In particular, with platforms with limited memory size such as an embedded system, there is concern that the overall performance of the system may decline or the cost of building the system may rise. Especially, since reassembly is one of the processes in protocol processing whose processing load is the heaviest, the area of the bit table is sometimes implemented by an SRAM or the like that is expensive but nevertheless fast. In this case, it is assumed that the problem of increased cost will become even more significant.